let arr = ['a', 'b', 'c', 'd', 'e'];

Array.prototype.my_forEach = function (cb) {
  for (let i = 0; i < this.length; i++) {
    cb(this[i], i, this);
  }
}

arr.my_forEach((item, index, arr) => {
  console.log(item, index, arr);
})